====== getVariables() ======

''array **getVariables**()''\\
''array **getVariables**(string //Filter//)''\\
''array **getVariables**(array //Filter//)''

The function ''getVariables()'' returns a list of variable names matching the filter ''$filter''. If no filter is specified, the function returns a list of all variables in the question catalogue.

  * //Filter//\\ The identifier of a category of a question can be assigned as a filter or as a question. Multiple categories and/or questions can be assigned as filter, either as an array or delimited with commas.

===== Return value =====

The function returns an array with variable names. If individual variable names have been assigned for the variables in the variable catalogue, these are used.

===== Example =====

<code php>
// Return variables of a single category
$vars = getVariables('AB');
debug($vars);

// Return variables of a category and of two questions
$vars = getVariables(['AB', 'BC02', 'BC03']);
debug($vars);

// Denote a filter that is delimited by a comma
$vars = getVariables('AB,BC02,BC03');
debug($vars);

// Return all variables from the question catalogue
$vars = getVariables();
debug($vars);
</code>

The function ''debug()'', for example, displays the identified variable list in the [[:en:create:debugging|debug mode]].
